import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'



Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'

// 引入路由
import router from "@/utils/router/index.js";
// 引入api
import api from '@/api/index.js'
// 引入store
import {store} from '@/store/store.js'
// 引入工具类
import tools from '@/utils/tools/index.js'
// 检查是否登录
import { isLogin } from '@/utils/login/isLogin.js'
// 引入webview
import webview from '@/utils/webview/index.js'
// 引入toast laoding
import { toast, loading } from '@/utils/modals/index.js';

export function createApp() {
  const app = createSSRApp(App)
  // 挂载路由 
	app.config.globalProperties.$router = router
	// 挂载api
	app.config.globalProperties.$api = api
	// 使用store
	app.use(store)
  // 挂载工具类
	app.config.globalProperties.$tools = tools
	// 挂载isLogin
	app.config.globalProperties.$isLogin = isLogin
	// 挂载webview
	app.config.globalProperties.$webview = webview
	// 挂载toast、loading
	app.config.globalProperties.$toast = toast
	app.config.globalProperties.$loading = loading
  return {
    app
  }
}
// #endif